﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CommonRepositoryInterface
{
    public class Database: IDatabase
    {
        public const int NewRecordId = 0;
        public Database(IRepositoryProvider provider)
        {
            this.Provider = provider;
        }

        public IRepositoryProvider Provider { get; private set; }

        public void Dispose()
        {
            if(this.Provider is IDisposable)
                ((IDisposable)this.Provider).Dispose();
        }

        #region IDatabase Members


        public void SubmitChanges()
        {
            this.Provider.SubmitChanges();
        }

        #endregion
    }
}
